/**
 * fileName: CS_YLES_Import_item_barcode_History
 * @NApiVersion 2.1
 * @NScriptType ClientScript
 */

import {EntryPoints} from 'N/types'
import search = require('N/search')
import {exportMyCSV, initCSVProgress} from "../tools/YLES_CLIENT_TOOL";

export function pageInit(cxt: EntryPoints.Client.pageInitContext) {

    //判断是否启动进度条
    if ( jQuery('#import_csv_progress').length > 0){
        try {
            initCSVProgress();
        }catch (e) {
            console.log('启动进度条失败',e);
        }
    }

}

//执行下载
export function exportCSV() {
    return exportMyCSV();
}

//刷新界面
export function refresh() {
    window.onbeforeunload = null;
    window.location.reload();
}